﻿using System.Collections.Generic;
using System.Linq;

namespace PivotalTrackerAPI.Domain.Model
{
    public class PivotalProject
    {
        public List<PivotalStory> Stories { get; set; }
        
        public List<PivotalStory> Bugs { get
            {
                return Stories.Where(x => x.StoryType == Enumerations.PivotalStoryType.bug).ToList();
            } 
        }

        public List<PivotalStory> Chores
        {
            get
            {
                return Stories.Where(x => x.StoryType == Enumerations.PivotalStoryType.chore).ToList();
            }
        }

        public List<PivotalStory> Features
        {
            get
            {
                return Stories.Where(x => x.StoryType == Enumerations.PivotalStoryType.feature).ToList();
            }
        }
    }
}
